package com.day02;

/**
 * @Author liuyuan
 * @Date 2022/11/7 9:35 AM
 * @Version 1.0
 */
public class string {

    public static void main(String[] args) {
        String str1 = "ABCIJBCC";
        String newStr1 = str1.replace("C", "*");
        System.out.println(newStr1);
        String str2 = "A-B-C-D";
        String[] split = str2.split("-");
        String res = "";
        for(int i=0;i<split.length;i++){
//            res = res + split[i];
            System.out.println(split[i]);
        }
        System.out.println(res);
        String[] split1 = str2.split("-", 2);
        for(int i=0;i<split1.length;i++){
//            res = res + split[i];
            System.out.println(split[i]);
        }
        String str3 = "AJKBNDK";
        String substring = str3.substring(2);
        System.out.println(substring);
        String substring1 = str3.substring(2, 5);
        System.out.println(substring1);

    }
}
